<?php

use Illuminate\Database\Seeder;

class AdminsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $time = date('Y-m-d H:i:s');
        for($i = 0; $i < 500; $i++)
        {
            $data=
                [
                'name' => str_random(10),
                'email' => str_random(10).'@gmail.com',
                'password' => Crypt::encryptString('123456'),
                'phone' => '13788888888',
                'token' => str_random(50),
                'airline' => 0,
                'status' => 0,
                'created_at' => $time,
                'updated_at' => $time,
                ];

            $adminId = DB::table('admins')->insertGetId($data);
            $pic = "/uploads/avatar/default.jpg";

            DB::table('admins_info') -> insert([
                'admin_id' => $adminId,
                'pic' => $pic,
                'created_at' => $time,
                'updated_at' => $time,

                ]);

        }

    }
}
